package com.chz.SupermarketMS.service;

import com.chz.SupermarketMS.dao.SDetailsRepository;
import com.chz.SupermarketMS.entities.SDetails;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SDetailsService {
    @Autowired
    SDetailsRepository sDetailsRepository;

    public SDetails save(SDetails sDetails){
        return sDetailsRepository.save(sDetails);
    }

    public List<SDetails> getAll(){
        return sDetailsRepository.findAll();
    }

    public SDetails findBySpId(long theId) {
        return  sDetailsRepository.findBySpId(theId);
    }

    public void delete(SDetails theSDetails) {
        sDetailsRepository.delete(theSDetails);
    }

//    public SDetails findBySDetailsId(long theId) {
//        return  sDetailsRepository.findBySDetailsId(theId);
//    }

//    public void delete(SDetails theSDetails) {
//        sDetailsRepository.delete(theSDetails);
//    }
}
